<!--
 * @Descripttion : 
 * @Autor        : Lilong
 * @Date         : 2022-09-30 16:27:57
 * @LastEditTime : 2022-09-30 16:28:07
 * @FilePath     : \表单控件绑定\v-model和组件\第四种(自定义v-model修饰符)\带参数的修饰符\第二种写法：script setup\my-component.vue
-->
// src/components/my-component.vue

<template>
    <input type="text" 
      :value="description"
      @input="$emit('update:description', $event.target.value)"
    >
</template>

<script setup>
import {onMounted} from 'vue'
const emits = defineEmits(["update:description"])
// 修饰符capitalize通过arg参数[改变的默认属性名称]+"Modifiers"提供给组件：即description + Modifiers
// 通过props来接收
const props = defineProps(["description", "descriptionModifiers"])
onMounted(() => {
    console.log('1', props.descriptionModifiers.capitalize) // true
})
</script>